<template>
  <div>
    <el-table :data="list" stripe>
    <el-table-column prop="companyName" label="公司名"> </el-table-column>
    <el-table-column prop="companyLogo" label="log">
      <template v-slot="scope">
        <img class="wx" :src="scope.row.companyLogo" alt="" />
      </template>
    </el-table-column>
  </el-table>

   <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="date"
        label="日期"
        width="180">
      </el-table-column>
      <el-table-column
        prop="name"
        label="姓名"
        width="180">
      </el-table-column>
      <el-table-column
        prop="address"
        label="性别">
        <template v-slot='scope'>
          {{is(scope.row.address)}}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  data () {
    return {
      list: [
        {
          companyName: '小米',
          companyLogo: 'http://s02.mifile.cn/assets/static/image/logo-mi2.png'
        },
        {
          companyName: '京东',
          companyLogo: 'https://misc.360buyimg.com/lib/img/e/logo-201305-b.png'
        },
        {
          companyName: '百度',
          companyLogo:
            'https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png'
        }
      ],

      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: 1
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: 0
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: 1
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '0'
      }]
    }
  },
  methods: {
    is (i) {
      const arr = ['女', '男']
      return arr[i]
    }
  }
}
</script>
<style scoped>
.wx{
  width: 100px;

}
</style>
